package com.mybank.myaccounts.service;

import com.mybank.myaccounts.dto.AccountApplicationDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

public interface AccountApplicationService {
    
    /**
     * Create a new account application
     * 
     * @param userId the user ID
     * @param applicationDto the application data
     * @return the created application
     */
    AccountApplicationDto createApplication(Long userId, AccountApplicationDto applicationDto);
    
    /**
     * Get an application by ID
     * 
     * @param applicationId the application ID
     * @return the application if found
     */
    Optional<AccountApplicationDto> getApplicationById(Long applicationId);
    
    /**
     * Get all applications for a user
     * 
     * @param userId the user ID
     * @return list of applications
     */
    List<AccountApplicationDto> getApplicationsByUserId(Long userId);
    
    /**
     * Get all applications for a user with a specific status
     * 
     * @param userId the user ID
     * @param status the application status
     * @return list of applications
     */
    List<AccountApplicationDto> getApplicationsByUserIdAndStatus(Long userId, String status);
    
    /**
     * Get all applications with pagination
     * 
     * @param pageable pagination information
     * @return page of applications
     */
    Page<AccountApplicationDto> getAllApplications(Pageable pageable);
    
    /**
     * Update an application status
     * 
     * @param applicationId the application ID
     * @param status the new status
     * @param notes optional notes about the status change
     * @return the updated application
     */
    AccountApplicationDto updateApplicationStatus(Long applicationId, String status, String notes);
}